  CREATE TABLE TFWTIPO_LOG 
   (	COD_TIPO_LOG NUMBER(4,0) NOT NULL ENABLE, 
	NOME_TIPO_LOG VARCHAR2(64), 
	IND_TIPO_LOG_ATIV NUMBER(1,0), 
	DESC_TIPO_LOG VARCHAR2(255) NOT NULL ENABLE, 
	 CONSTRAINT PK_TFWTIPO_LOG PRIMARY KEY (COD_TIPO_LOG)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
/
 
  CREATE TABLE TFWLOG 
   (	COD_LOG NUMBER(20,0) NOT NULL ENABLE, 
	COD_TIPO_LOG NUMBER(4,0) NOT NULL ENABLE, 
	DATA_LOG DATE, 
	NOME_CLAS VARCHAR2(512), 
	NUM_IP VARCHAR2(20), 
	COD_IDT_SESS_USUA VARCHAR2(128), 
	COD_EMP NUMBER(5,0), 
	NOME_USUA VARCHAR2(128), 
	 CONSTRAINT PK_TFWLOG PRIMARY KEY (COD_LOG)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE, 
	 CONSTRAINT FK01_TFWLOG_TFWTIPO_LOG FOREIGN KEY (COD_TIPO_LOG)
	  REFERENCES TFWTIPO_LOG (COD_TIPO_LOG) ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 
/
  CREATE TABLE TFWDET_LOG 
   (	COD_LOG NUMBER(20,0) NOT NULL ENABLE, 
	COD_DET_LOG NUMBER(3,0) NOT NULL ENABLE, 
	NOME_DET_LOG VARCHAR2(128), 
	TXT_CNTD_DET_LOG VARCHAR2(4000), 
	 CONSTRAINT PK_TFWDET_LOG PRIMARY KEY (COD_LOG, COD_DET_LOG)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE, 
	 CONSTRAINT FK01_TFWDET_LOG_TFWLOG FOREIGN KEY (COD_LOG)
	  REFERENCES TFWLOG (COD_LOG) ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 
/
  CREATE TABLE TFWDET_LOG_CPLX 
   (	COD_LOG NUMBER(20,0) NOT NULL ENABLE, 
	COD_DET_LOG NUMBER(3,0) NOT NULL ENABLE, 
	TXT_CNTD_DET_LOG CLOB, 
	 CONSTRAINT PK_TFWDET_LOG_CPLX PRIMARY KEY (COD_LOG, COD_DET_LOG)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE, 
	 CONSTRAINT FK01_TFWDET_LOG_CPLX_TFWDET_LO FOREIGN KEY (COD_LOG, COD_DET_LOG)
	  REFERENCES TFWDET_LOG (COD_LOG, COD_DET_LOG) ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWHASH_LOG 
   (	COD_LOG NUMBER(20,0) NOT NULL ENABLE, 
	COD_HASH VARCHAR2(255), 
	 CONSTRAINT PK_TFWHASH_LOG PRIMARY KEY (COD_LOG)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE, 
	 CONSTRAINT FK01_TFWHASH_LOG_TFWLOG FOREIGN KEY (COD_LOG)
	  REFERENCES TFWLOG (COD_LOG) ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWMENSAGEM 
   (	CODIGOMENSAGEM NUMBER NOT NULL ENABLE, 
	RESOURCEKEY VARCHAR2(99), 
	 CONSTRAINT PK_TFWMENSAGEM PRIMARY KEY (CODIGOMENSAGEM)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWEXCECAO 
   (	CODIGOEXCECAO NUMBER(12,0) NOT NULL ENABLE, 
	MENSAGEMEXCECAO VARCHAR2(255), 
	CODIGOMENSAGEM NUMBER, 
	MODULO VARCHAR2(255), 
	SUBMODULO VARCHAR2(255), 
	 CONSTRAINT PK_TFWEXCECAO PRIMARY KEY (CODIGOEXCECAO)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE, 
	 CONSTRAINT FK01_TFWEXCECAO_TFWMENSAGEM FOREIGN KEY (CODIGOMENSAGEM)
	  REFERENCES TFWMENSAGEM (CODIGOMENSAGEM) ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWTIPODIREITO 
   (	COD_TIPODIREITO NUMBER NOT NULL ENABLE, 
	DESC_TIPODIREITO VARCHAR2(250) NOT NULL ENABLE, 
	 CONSTRAINT PK_TFWTIPODIREITO PRIMARY KEY (COD_TIPODIREITO)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWDIREITO 
   (	COD_DIREITO NUMBER NOT NULL ENABLE, 
	DESC_DIREITO VARCHAR2(250) NOT NULL ENABLE, 
	COD_TIPODIREITO NUMBER NOT NULL ENABLE, 
	COD_TIPO_OPRC CHAR(1) DEFAULT 'R' NOT NULL ENABLE, 
	TXT_HASH VARCHAR2(512) DEFAULT ' ' NOT NULL ENABLE, 
	 CONSTRAINT PK_TFWDIREITO PRIMARY KEY (COD_DIREITO, COD_TIPODIREITO)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE, 
	 CONSTRAINT FK01_TFWDIREITO_TFWTIPODIREITO FOREIGN KEY (COD_TIPODIREITO)
	  REFERENCES TFWTIPODIREITO (COD_TIPODIREITO) ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWMENU 
   (	CD_MENU NUMBER NOT NULL ENABLE, 
	CD_MENUSUP NUMBER, 
	CD_FUNCAO CHAR(6), 
	CD_SISTEMA VARCHAR2(4), 
	DS_ASSEMBLY VARCHAR2(100), 
	DS_CLASSE VARCHAR2(100), 
	IN_BLOQUEIO CHAR(1) NOT NULL ENABLE, 
	DS_MENU VARCHAR2(150), 
	 CONSTRAINT PK_TFWMENU PRIMARY KEY (CD_MENU)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE, 
	 CONSTRAINT FK01_TFWMENU_TFWMENU FOREIGN KEY (CD_MENUSUP)
	  REFERENCES TFWMENU (CD_MENU) ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 131072 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWMODULOSINST 
   (	CD_SISTEMA VARCHAR2(4) NOT NULL ENABLE, 
	 CONSTRAINT PK_TFWMODULOSINST PRIMARY KEY (CD_SISTEMA)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE, 
	 FOREIGN KEY (CD_SISTEMA)
	  REFERENCES TGESIST (CD_SISTEMA) ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWDIR_MOD_SIST 
   (	COD_DIR NUMBER NOT NULL ENABLE, 
	COD_TIPO_DIR NUMBER NOT NULL ENABLE, 
	COD_SIST VARCHAR2(4) NOT NULL ENABLE, 
	TXT_HASH VARCHAR2(512), 
	 CONSTRAINT PK_TFWDIR_MOD_SIST PRIMARY KEY (COD_DIR, COD_TIPO_DIR, COD_SIST)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE, 
	 CONSTRAINT FK02_TFWDIR_MOD_SIST FOREIGN KEY (COD_DIR, COD_TIPO_DIR)
	  REFERENCES TFWDIREITO (COD_DIREITO, COD_TIPODIREITO) ENABLE, 
	 CONSTRAINT FK01_TFWDIR_MOD_SIST FOREIGN KEY (COD_SIST)
	  REFERENCES TFWMODULOSINST (CD_SISTEMA) ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWSESS 
   (	COD_SESS VARCHAR2(32) NOT NULL ENABLE, 
	CD_USUARIO NUMBER(6,0) NOT NULL ENABLE, 
	COD_EMP NUMBER(5,0) NOT NULL ENABLE, 
	DATA_EXP DATE NOT NULL ENABLE, 
	NOME_HOST_USUA VARCHAR2(50) NOT NULL ENABLE, 
	DATA_ATLZ DATE NOT NULL ENABLE, 
	 CONSTRAINT PK_TFWSESS PRIMARY KEY (COD_SESS, CD_USUARIO)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWSPOL_ACES 
   (	COD_POL_ACES NUMBER NOT NULL ENABLE, 
	NOME_POL_ACES VARCHAR2(250) NOT NULL ENABLE, 
	IND_SITU_POL_ACES NUMBER(1,0) NOT NULL ENABLE, 
	COD_TIPO_POL_ACES VARCHAR2(1) NOT NULL ENABLE, 
	IND_PERM_EDIC_DADO NUMBER(1,0), 
	IND_VISI_DADO NUMBER(1,0), 
	 PRIMARY KEY (COD_POL_ACES)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWLOGERROGERAL 
   (	CODIGOLOG NUMBER NOT NULL ENABLE, 
	DATALOG DATE, 
	CODIGOEMPRESA NUMBER(5,0), 
	CODIGOUSUARIO VARCHAR2(20), 
	IP VARCHAR2(15), 
	MODULO VARCHAR2(255), 
	SERVICO VARCHAR2(255), 
	METODO VARCHAR2(255), 
	DESCRICAO VARCHAR2(4000), 
	 CONSTRAINT PK_TFWLOGERROGERAL PRIMARY KEY (CODIGOLOG)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 13074432 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWLOGERRONEGOCIO 
   (	CODIGOLOG NUMBER NOT NULL ENABLE, 
	DATALOG DATE, 
	CODIGOEMPRESA NUMBER(5,0), 
	CODIGOUSUARIO VARCHAR2(20), 
	IP VARCHAR2(15), 
	MODULO VARCHAR2(255), 
	SERVICO VARCHAR2(255), 
	METODO VARCHAR2(255), 
	CODIGOERRO NUMBER(10,0), 
	DESCRICAO VARCHAR2(4000), 
	 CONSTRAINT PK_TFWLOGERRONEGOCIO PRIMARY KEY (CODIGOLOG)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 3424256 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWEXEC_SERV 
   (	COD_EXEC_SERV NUMBER NOT NULL ENABLE, 
	NOME_EXEC_SERV VARCHAR2(128) NOT NULL ENABLE, 
	NOME_MET_BASI VARCHAR2(128) NOT NULL ENABLE, 
	NOME_MET_ADIC VARCHAR2(128), 
	COD_TIPO_MET_EXEC CHAR(1) NOT NULL ENABLE, 
	 CONSTRAINT PK_TFWEXEC_SERV PRIMARY KEY (COD_EXEC_SERV)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWMOD_INTL 
   (	COD_MOD_INTL NUMBER NOT NULL ENABLE, 
	NOME_MOD_INTL VARCHAR2(50) NOT NULL ENABLE, 
	DESC_MOD_INTL VARCHAR2(120) NOT NULL ENABLE, 
	NOME_CMPT VARCHAR2(250) NOT NULL ENABLE, 
	NOME_CLAS_CMPT VARCHAR2(250) NOT NULL ENABLE, 
	 CONSTRAINT PK_TFWMOD_INTL PRIMARY KEY (COD_MOD_INTL)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWPROS_GDOR_PROS 
   (	COD_PROS NUMBER NOT NULL ENABLE, 
	COD_MOD_INTL NUMBER NOT NULL ENABLE, 
	NOME_PROS VARCHAR2(100) NOT NULL ENABLE, 
	DESC_PROS VARCHAR2(120) NOT NULL ENABLE, 
	COD_TIPO_CNTX_ISTA CHAR(1) NOT NULL ENABLE, 
	NOME_CLAS_CMPT VARCHAR2(250) NOT NULL ENABLE, 
	NOME_CMPT VARCHAR2(250) NOT NULL ENABLE, 
	COD_ACAO_PRIM_FALH_PROS CHAR(1), 
	COD_ACAO_SEGD_FALH_PROS CHAR(1), 
	COD_ACAO_FALH_SUBQ_PROS CHAR(1), 
	COD_TIPO_INIC_PROS CHAR(1), 
	TXT_SENH_AUTE_PROS VARCHAR2(255), 
	TXT_USUA_AUTE_PROS VARCHAR2(30), 
	 CONSTRAINT CK01_COD_TIPO_CNTX_ISTA2 CHECK (COD_TIPO_CNTX_ISTA IN ('S', 'M')) ENABLE, 
	 CONSTRAINT PK_TFWPROS_GDOR_PROS PRIMARY KEY (COD_PROS)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE, 
	 CONSTRAINT FK01_TFWPROS_GDOR_PROS FOREIGN KEY (COD_MOD_INTL)
	  REFERENCES TFWMOD_INTL (COD_MOD_INTL) ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWMSG_GDOR_PROS 
   (	COD_MSG NUMBER NOT NULL ENABLE, 
	COD_PROS NUMBER NOT NULL ENABLE, 
	DESC_MSG VARCHAR2(200) NOT NULL ENABLE, 
	 CONSTRAINT PK_TFWMSG_GDOR_PROS PRIMARY KEY (COD_MSG, COD_PROS)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_indice  ENABLE, 
	 CONSTRAINT FK01_TFWMSG_GDOR_PROS FOREIGN KEY (COD_PROS)
	  REFERENCES TFWPROS_GDOR_PROS (COD_PROS) ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWTIPO_MSG_PFIX 
   (	COD_TIPO_MSG_PFIX CHAR(3) NOT NULL ENABLE, 
	DESC_TIPO_MSG_PFIX NVARCHAR2(128) NOT NULL ENABLE, 
	 CONSTRAINT PK_TFWTIPO_MSG_PFIX PRIMARY KEY (COD_TIPO_MSG_PFIX)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE TFWMSG_ORDE_RECB 
   (	COD_MSG NUMBER NOT NULL ENABLE, 
	DATA_RECB_MSG DATE NOT NULL ENABLE, 
	TXT_MSG CLOB NOT NULL ENABLE, 
	COD_TIPO_MSG_PFIX CHAR(3) NOT NULL ENABLE, 
	COD_EMP NUMBER(5,0) NOT NULL ENABLE, 
	COD_SEQ_MSG NUMBER NOT NULL ENABLE, 
	 CONSTRAINT PK_TFWMSG_ORDE_RECB PRIMARY KEY (COD_MSG)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados  ENABLE, 
	 CONSTRAINT FK01_AFWMSG_ORDE_RECB FOREIGN KEY (COD_TIPO_MSG_PFIX)
	  REFERENCES TFWTIPO_MSG_PFIX (COD_TIPO_MSG_PFIX) ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
  CREATE TABLE LFWLOG_GDOR_PROS 
   (	COD_IDT_TAB NUMBER NOT NULL ENABLE, 
	NOME_LOGN_USUA VARCHAR2(128) NOT NULL ENABLE, 
	DATA_INIC_PROS DATE NOT NULL ENABLE, 
	DATA_FIM_PROS DATE, 
	DESC_ERRO VARCHAR2(1024), 
	IND_CONC_SUCE CHAR(1) NOT NULL ENABLE, 
	COD_PROS NUMBER, 
	 CONSTRAINT PK_LFWLOG_GDOR_PROS PRIMARY KEY (COD_IDT_TAB)
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados  ENABLE, 
	 CONSTRAINT FK01LFWLOG_GDOR_PROS FOREIGN KEY (COD_PROS)
	  REFERENCES TFWPROS_GDOR_PROS (COD_PROS) ON DELETE SET NULL ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 311296 NEXT 311296 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE &tablespace_dados 
 /
   CREATE SEQUENCE  SFWSESS  MINVALUE 1 MAXVALUE 10000000 INCREMENT BY 1 START WITH 125972 CACHE 20 NOORDER  NOCYCLE 
 /
   CREATE SEQUENCE  SLFWLOG_GDOR_PROS  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER  NOCYCLE 
 /
   CREATE SEQUENCE  SQFW_LOGGERAL  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 5900 CACHE 20 NOORDER  NOCYCLE 
 /
   CREATE SEQUENCE  SQFW_LOGNEGOCIO  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 6646 CACHE 20 NOORDER  NOCYCLE 
 /
   CREATE SEQUENCE  STFWDIREITO  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 94817 CACHE 20 ORDER  NOCYCLE 
 /
   CREATE SEQUENCE  STFWLOG  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 40741 CACHE 20 NOORDER  NOCYCLE 
 /
   CREATE SEQUENCE  STFWMSG_ORDE_RECB  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 2401 CACHE 20 NOORDER  NOCYCLE 
 /
   CREATE SEQUENCE  STFWTIPODIREITO  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 19 CACHE 3 ORDER  NOCYCLE 
 /
   CREATE OR REPLACE TRIGGER TRG_INSTFWDIREITO BEFORE INSERT ON TFWDIREITO  FOR EACH ROW  BEGIN   SELECT STFWDIREITO.NEXTVAL INTO :NEW.COD_DIREITO FROM DUAL; END;  
/
ALTER TRIGGER TRG_INSTFWDIREITO ENABLE 
/
  CREATE OR REPLACE TRIGGER TRG_INSTFWSESS before INSERT ON TFWSESS FOR EACH ROW BEGIN   IF inserting THEN     IF :NEW.COD_SESS IS NULL THEN       SELECT SFWSESS.nextval       INTO :NEW.COD_SESS       FROM dual;     END IF;   END IF; END;  
/
ALTER TRIGGER TRG_INSTFWSESS ENABLE 
/
  CREATE OR REPLACE TRIGGER TRG_INSTFWTIPODIREITO BEFORE INSERT ON TFWTIPODIREITO  FOR EACH ROW  BEGIN   SELECT STFWTIPODIREITO.NEXTVAL INTO :NEW.COD_TIPODIREITO FROM DUAL; END;  
/
ALTER TRIGGER TRG_INSTFWTIPODIREITO ENABLE 
/
  CREATE OR REPLACE TRIGGER TRG_INS_TFWMSG_ORDE_RECB BEFORE INSERT ON TFWMSG_ORDE_RECB FOR EACH ROW  BEGIN SELECT STFWMSG_ORDE_RECB.NEXTVAL INTO :NEW.COD_MSG FROM DUAL; END;  
/
ALTER TRIGGER TRG_INS_TFWMSG_ORDE_RECB ENABLE 
/
  CREATE OR REPLACE PACKAGE FUNC_FW as    type cursortype is ref cursor;    type rfuncao is record(       cd_funcao char(6));    type tfuncao is table of rfuncao index by binary_integer;    function fnfw_retornaarvorefuncao(funcao  in char,                                      sistema in varchar2) return tfuncao; end;    
 /
  CREATE OR REPLACE PACKAGE BODY FUNC_FW is     function fnfw_retornaarvorefuncao(funcao  in char,                                      sistema in varchar2) return tfuncao is       funsup  char(6);       tf      tfuncao;       tf_ret  tfuncao;       rf      rfuncao;       v_index number(5);    begin       begin          select distinct cd_funsup          into   funsup          from   tgefuncao          where  cd_funcao = funcao          and    cd_sistema = sistema;       exception          when no_data_found then             funsup := null;       end;           if (funsup is not null)       then          tf_ret := fnfw_retornaarvorefuncao(funsup,                                             sistema);          for i in tf_ret.first .. tf_ret.last          loop             tf(i) := tf_ret(i);          end loop;       end if;           if (tf.last is not null)       then          v_index := tf.last + 1;       else          v_index := 0;       end if;           rf.cd_funcao := funcao;       tf(v_index) := rf;       return tf;    end fnfw_retornaarvorefuncao; end;    
 /
  CREATE OR REPLACE PACKAGE SWPROC_FW AS  procedure  spfw_SaveLog(p_codigoempresa in number,p_codigousuario in varchar2,p_ip in varchar2, p_modulo in varchar2, p_servico in varchar2, p_metodo in varchar2, p_codigoErro in number,p_descricao in varchar2, p_erroGeral in char, p_codLog out number);  END SWPROC_FW;   
 /
  CREATE OR REPLACE PACKAGE BODY SWPROC_FW is  procedure spfw_SaveLog(p_codigoempresa in number,p_codigousuario in varchar2,p_ip in varchar2, p_modulo in varchar2, p_servico in varchar2, p_metodo in varchar2, p_codigoErro in number,p_descricao in varchar2, p_erroGeral in char, p_codLog out number)  is  p_data date;  begin  p_data := SYSDATE;  if (upper(p_erroGeral)='S') then  select sqfw_LogGeral.NextVal into p_codLog from dual;  insert into TFWLOGERROGERAL(CODIGOLOG,DATALOG,CODIGOEMPRESA,CODIGOUSUARIO, IP, MODULO, SERVICO, METODO, DESCRICAO)  values(p_codLog,p_DATA,p_CODIGOEMPRESA,p_CODIGOUSUARIO,p_IP, p_MODULO, p_SERVICO, p_METODO, p_DESCRICAO);  else  select sqfw_LogNegocio.NextVal into p_codLog from dual;  insert into TFWLOGERRONEGOCIO(CODIGOLOG, DATALOG, CODIGOEMPRESA, CODIGOUSUARIO, IP, MODULO, SERVICO, METODO, CODIGOERRO, DESCRICAO)  values(p_codLog, p_DATA, p_CODIGOEMPRESA, p_CODIGOUSUARIO, p_IP, p_MODULO, p_SERVICO, p_METODO, p_CODIGOERRO, p_DESCRICAO);  end if;  end;  END SWPROC_FW;   
/